
pkgname=libxml2
pkgver=2.9.8
pkgrel=1
pkgdesc="XML parsing library, version 2"
arch=('x86_64')
license=('MIT')
depends=('zlib' 'readline' 'ncurses' 'xz')
makedepends=('python2')
options=('!libtool')
url="http://www.xmlsoft.org/"
source=("ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"
        "http://www.w3.org/XML/Test/xmlts20080827.tar.gz"
        "https://github.com/GNOME/libxml2/commit/3f0627a1ee854dc965bf61dd6466a798b80cf088.diff")
md5sums=('b786e353e2aa1b872d70d5d1ca0c740d'
         'ae3d1ebe000a3972afa104ca7f0e1b4a'
         '98fd3c2502dce1a1fd45ca3efbb87ca7')

build() {
  cd ${pkgname}-${pkgver}
  # bug for qtwebkit issues, example https://github.com/Sigil-Ebook/Sigil/issues/232
  #patch -p1 -i ${srcdir}/3f0627a1ee854dc965bf61dd6466a798b80cf088.diff
  
  ./configure --prefix=/usr \
     --with-threads \
     --with-history 
  make
}

check() {
  cd ${pkgname}-${pkgver}
  
  mv ${srcdir}/xmlconf .
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  
  make DESTDIR=${pkgdir} install
  install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
}
